<div class="sidebar-second order-navBox">
    <ul id="accordion" class="accordion">

        <li>
            <a {if condition="in_array($Request.action, ['index'])"}class="active"{/if} href='{:url("Statistics/index")}'>
                交易分析
            </a>
        </li>
        <li>
            <a {if condition="in_array($Request.action, ['users_index'])"}class="active"{/if} href='{:url("Statistics/users_index")}'>
                会员分析
            </a>
        </li>
    </ul>
</div>
<script>
$(function() {
    var Accordion = function(el, multiple) {
        this.el = el || {};
        this.multiple = multiple || false;

        // Variables privadas
        var links = this.el.find('.link');
        // Evento
        links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
    };

    Accordion.prototype.dropdown = function(e) {
        var $el = e.data.el;
            $this = $(this);
            $next = $this.next();

        $next.slideToggle();
        // $this.parent().toggleClass('open');

        if (!e.data.multiple) {
            $el.find('.submenu').not($next).slideUp().parent().removeClass('open');
        }
    };

    var accordion = new Accordion($('#accordion'), false);
    $('.submenu li').click(function () {
        $(this).addClass('current').siblings('li').removeClass('current');
    });
});
</script>